<#include "/common/include.html"/>
<@pageTheme mark="${config.optimize()?string('true', 'false')}">
<@header title="销售订单列表">
</@header>
<@search fromId="saleorder-form">
<div class="select-list">
    <ul>
        <li><@ctx.i18n text = "流程实例ID"/>：<input type="text" name="processInstanceId"/></li>
        <li><@ctx.i18n text = "订单号"/>：<input type="text" name="saleCode"/></li>
        <li>
            <@ctx.i18n text = "订单状态"/>：
            <select name="saleStatus" class="form-control">
                <option value=""><@ctx.i18n text = "所有"/></option>
            <#list dict.getType('saleorder_status')>
                <#items as d>
                    <#if d.status =='0' >
                        <option value="${d.dictValue}" text="${d.dictLabel}"><@ctx.i18n text = "${d.dictLabel}"/></option>
                    </#if>
                </#items>
            </#list>
            </select>
        </li>
        <li><@ctx.i18n text = "客户名称"/>：<input type="text" name="saleCustomername"/></li>
        <li><@ctx.i18n text = "客户地址"/>：<input type="text" name="saleAddress"/></li>
        <li><@ctx.i18n text = "客户手机号"/>：<input type="text" name="salePhone"/></li>
        <li><@ctx.i18n text = "客户邮箱"/>：<input type="text" name="saleEmail"/></li>
        <li><@ctx.i18n text = "客户微信"/>：<input type="text" name="saleWechat"/></li>
        <li>
            <@ctx.i18n text = "ID"/>：
            <select name="saleId" class="form-control">
                <option value=""><@ctx.i18n text = "所有"/></option>
            <#list dict.getType('sale_id_status')>
                <#items as d>
                    <#if d.status =='0' >
                        <option value="${d.dictValue}" text="${d.dictLabel}"><@ctx.i18n text = "${d.dictLabel}"/></option>
                    </#if>
                </#items>
            </#list>
            </select>
        </li>
        <li><@ctx.i18n text = "驾照"/>：<input type="text" name="saleDriverlicense"/></li>
        <li><@ctx.i18n text = "护照"/>：<input type="text" name="salePassport"/></li>
        <li><@ctx.i18n text = "房产信息"/>：<input type="text" name="saleResidenceinfo"/></li>
        <li><@ctx.i18n text = "销售员"/>：<input type="text" name="salePerson"/></li>
        <li><@ctx.i18n text = "销售组"/>：<input type="text" name="saleTeam"/></li>
        <li><@ctx.i18n text = "销售经理"/>：<input type="text" name="saleManager"/></li>
        <li>
            <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;&nbsp;<@ctx.i18n text = "查询"/></a>
            <a class="btn btn-warning btn-rounded btn-sm" onclick="opt.form.reset()"><i class="fa fa-refresh"></i>&nbsp;<@ctx.i18n text = "重置"/></a>
        </li>
    </ul>
</div>
</@search>
<@table tableId="bootstrap-table">
    <@shiro.hasPermission name="bpm:saleorder:add">
        <a class="btn btn-success" onclick="opt.operate.add()"><i class="fa fa-plus"></i>&nbsp;<@ctx.i18n text = "新增"/></a>
    </@shiro.hasPermission>
    <@shiro.hasPermission name="bpm:saleorder:edit">
        <a class="btn btn-primary single disabled" onclick="opt.operate.edit()"><i class="fa fa-pencil-square-o"></i>&nbsp;<@ctx.i18n text = "修改"/></a>
    </@shiro.hasPermission>
    <@shiro.hasPermission name="bpm:saleorder:del">
        <a class="btn btn-danger multiple disabled" onclick="opt.operate.delAll()"><i class="fa fa-remove"></i> <@ctx.i18n text = "删除"/></a>
    </@shiro.hasPermission>
</@table>
<@footer>
<script>
    var editFlag = "${permission.hasPermi("bpm:saleorder:edit")}";
    var listFlag = "${permission.hasPermi("bpm:saleorder:add")}";
    var delFlag = "${permission.hasPermi("bpm:saleorder:del")}";
    var visible = ${permission.isPermitteds("bpm:saleorder:edit,bpm:saleorder:del,bpm:saleorder:add")?string('true', 'false')};
   var saleStatusDatas = ${dict.getDictListJson('saleorder_status')};
   var saleIdDatas = ${dict.getDictListJson('sale_id_status')};
    var prefix = baseURL + "bpm/saleorder";

    $(function() {
        var options = {
            url: prefix + "/list",
            addUrl: prefix + "/add",
            editUrl: prefix + "/edit/{id}",
            delUrl: prefix + "/del",
            modalName: "销售订单",
            uniqueId:    'id'/* 唯一ID */                                                     ,
            columns: [
                         {title: $.i18n.prop("序号"), width: 5, align: "center", formatter: function (value, row, index) {
                                    return $.table.serialNumber(index);
                         }}
                        ,{field : 'id',title : '<@ctx.i18n text = "主键"/>',visible: false}                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                
                        ,{field : 'processInstanceId',title : '<@ctx.i18n text = "流程实例ID"/>'}                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 
                        ,{field : 'saleCode',title : '<@ctx.i18n text = "订单号"/>'}                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             
                        ,{field : 'salePerson',title : '<@ctx.i18n text = "销售员"/>'}                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 
                        ,{field : 'saleTeam',title : '<@ctx.i18n text = "销售组"/>'}                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 
                        ,{field : 'saleManager',title : '<@ctx.i18n text = "销售经理"/>'}                                                                                                                                                         
                        ,{field : 'saleStatus',title : '<@ctx.i18n text = "订单状态"/>',formatter: function(value, row, index) {
                                return $.table.selectDictLabels(saleStatusDatas, value);
                        }}                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 
                        ,{field : 'saleCustomername',title : '<@ctx.i18n text = "客户名称"/>'}                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 
                        ,{field : 'saleAddress',title : '<@ctx.i18n text = "客户地址"/>'}                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 
                        ,{field : 'salePhone',title : '<@ctx.i18n text = "客户手机号"/>'}                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 
                        ,{field : 'saleEmail',title : '<@ctx.i18n text = "客户邮箱"/>'}                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 
                        ,{field : 'saleWechat',title : '<@ctx.i18n text = "客户微信"/>'}                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 
                        ,{field : 'saleId',title : '<@ctx.i18n text = "ID"/>',formatter: function(value, row, index) {
                                return $.table.selectDictLabels(saleIdDatas, value);
                        }}                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 
                        ,{field : 'saleDriverlicense',title : '<@ctx.i18n text = "驾照"/>'}                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 
                        ,{field : 'salePassport',title : '<@ctx.i18n text = "护照"/>'}                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 
                        ,{field : 'saleResidenceinfo',title : '<@ctx.i18n text = "房产信息"/>'}                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 
                        ,{field : 'remark',title : '<@ctx.i18n text = "备注"/>'}                                                                                                                                         
                        ,{title:"<@ctx.i18n text = "操作"/>",align: 'left',visible:visible,formatter: function(value, row, index) {
                            var actions = [];
                            actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="opt.operate.edit(\'' + row.id + '\')"><i class="fa fa-edit"></i>编辑</a> ');
                            actions.push('<a class="btn btn-danger btn-xs ' + delFlag + '" href="javascript:void(0)" onclick="opt.operate.del(\'' + row.id + '\')"><i class="fa fa-remove"></i>删除</a>');
                            return actions.join('');
                        }}
                    ]
            };
         $.table.init(options);
     });
</script>
</@footer>
</@pageTheme>